package com.zhu.gmall.flume.utils;

import com.alibaba.fastjson.JSONObject;
import com.zhu.gmall.flume.interceptor.ETLInterceptor;

import java.util.ArrayList;

/**
 * JSON格式校验  json合法性
 * parseObject 方法 通过异常校验合法性
 */
public class JSONUtil {

    public static boolean isJSONValidate(String log) {
        try {
            JSONObject.parseObject(log);
            return true;
        }catch (Exception e){
            return false;
        }
    }



    /*
    public static void main(String[] args) {
     //   System.out.println(JSONObject.parseObject("{id:"));
        ArrayList<String> arrayList = new ArrayList<>();
        arrayList.add("a");
        arrayList.add("b");
        arrayList.add("c");
        System.out.println(arrayList);
        ETLInterceptor etlInterceptor = new ETLInterceptor();
      }
     */


}
